home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 636 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.2 KB

  1. Path: ix.netcom.com!netnews
  2. From: miker3@ix.netcom.com (Mike Rubenstein)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Coding Standards are ignorant
  5. Date: Sat, 23 Mar 1996 05:20:26 GMT
  6. Organization: Netcom
  7. Message-ID: <31536199.219868914@nntp.ix.netcom.com>
  8. References: <4gum82$14v4@info4.rus.uni-stuttgart.de><MIB.96Mar15170902@gnu.ai.mit.edu><wyraut5fqq.fsf@dns.bluesky.net><MIB.96Mar16174948@gnu.ai.mit.edu><4ifq40$i87@sundog.tiac.net><MIB.96Mar18105957@gnu.ai.mit.edu><danpop.827188302@rscernix> <MPLANET.31530e9djcoffin98993e@news.rmii.com>
  9. NNTP-Posting-Host: ix-dc11-22.ix.netcom.com
  10. X-NETCOM-Date: Fri Mar 22  9:19:52 PM PST 1996
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. jcoffin@rmii.com (Jerry Coffin) wrote:
  14.  
  15. > In article <danpop.827188302@rscernix>, danpop@mail.cern.ch says...
  16. > > In <MIB.96Mar18105957@gnu.ai.mit.edu> mib@gnu.ai.mit.edu (Michael I. 
  17. > Bushnell, p/BSG) writes:
  18. > > 
  19. > > >You are not guaranteed that long is the widest integral type.  
  20. > > 
  21. > > Yes, you are.  ANSI classic 3.1.2.5:
  22. > > 
  23. > >     There are four signed integer types, designated as signed char, 
  24. > >     short int, int, and long int.
  25. > > 
  26. > > The standard doesn't leave any place for extensions here.
  27. > Uless I'm missing something, extensions shold be perfectly legal at least if 
  28. > their names are in the implementor's name space, or are in the user's name 
  29. > space only if a non-standard header in included, a pragma is used, etc.
  30. > I can't see any way for a strictly conforming program to be affected by the 
  31. > compiler supporting something like _VeryLong or __int128.  Have I missed 
  32. > something obvious?
  33.  
  34. You've missed a rather subtle point.  Such extensions are legal but
  35. they do not introduce integer types.  The standard defines the signed
  36. integer types as being signed char, short int, int, and long int (and
  37. similarly for unsigned integer types).  An implementation may
  38. introduce new types that behave like integers, but according to the
  39. standard they are not integer types.
  40.  
  41. This is important since it guarantees, for example, that size_t is
  42. unsigned char, unsigned short, unsigned int, or unsigned long.  An
  43. implementation cannot define size_t as being unsigned _VeryLong
  44. (assuming, of course, that unsigned _VeryLong is a new type).
  45.  
  46.  
  47. Michael M Rubenstein
  48.